package com.blog.backend.resp;

import lombok.Getter;
import lombok.Setter;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;

@Setter
@Getter
public class TravelResp {

    private String travelId;

    private String travelTitle;

    private String travelContent;

    private String travelImg;

    private String preContent;

    private List<PictureUrlResp> travelImageList;

    private Date travelTime;

    private String createTime;

    private String travelAddress;

    private String travelTimeStr;

    private Integer status;

    private String statusName;

    private Integer likeNum;

    private Integer recommend;

    private Integer browseNum;

    private String draftName;



    public String getStatusName() {
        if (this.status==1){
            return "草稿";
        }else {
            return "已完成";
        }
    }

    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }

    public String getTravelTimeStr() {
        SimpleDateFormat format=new SimpleDateFormat("yyyy-MM-dd");
        return format.format(this.travelTime);
    }
}
